import java.util.Arrays;
import java.util.Scanner;

public class Two {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int[] arr=new int[n*3];
        for (int i = 0; i < n * 3; i++) {
            arr[i]=in.nextInt();
        }
        Arrays.sort(arr);
        int pos=n*3-2,count=1;
        long ret=0;
        while (count++<=n){
            ret+=arr[pos];
            pos-=2;
        }
        System.out.println(ret);
    }
}
